<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js"><span id='global-property-'>/**
</span> * @ignore
 * comment node (&lt;!-- content --&gt;)
 * @author yiminghe@gmail.com
 */
KISSY.add(&quot;html-parser/nodes/comment&quot;, function (S, Text) {

    function Comment() {
        Comment.superclass.constructor.apply(this, arguments);
        this.nodeType = 8;
        this.nodeName = &quot;#comment&quot;;
    }

    S.extend(Comment, Text, {
        writeHtml:function (writer, filter) {
            var ret;
            if (!filter || (ret = filter.onComment(this)) !== false) {
                if (ret) {
                    if (this !== ret) {
                        ret.writeHtml(writer, filter);
                        return;
                    }
                }
                writer.comment(this.toHtml());
            }
        },
        toHtml:function () {
            if (this.nodeValue) {
                return this.nodeValue;
            } else {
                var value = Text.superclass.toHtml.apply(this, arguments);
                // &lt;!-- --&gt;
                return value.substring(4, value.length - 3);
            }
        }
    });

    return Comment;
}, {
    requires:['./text']
});</pre>
</body>
</html>
